//
//  UIBarButtonItem+GHBarBTN.m
//  12-guhu_weibo
//
//  Created by GHapple on 15-1-31.
//  Copyright (c) 2015年 itcast. All rights reserved.
//

#import "UIBarButtonItem+GHBarBTN.h"

@implementation UIBarButtonItem (GHBarBTN)

+ (UIBarButtonItem *)itemWithImage:(NSString *)image higImage:(NSString *)higImage target:(id)target action:(SEL)action{
    
    UIButton *btn = [[UIButton alloc]init];
    [btn setImage:[UIImage imageNamed:image] forState:UIControlStateNormal];
    [btn setImage:[UIImage imageNamed:higImage] forState:UIControlStateHighlighted];
    // 添加frame
    btn.size = btn.currentImage.size;
    // 添加监听事件
    
    [btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    
    
    
    return [[UIBarButtonItem alloc]initWithCustomView:btn];
}
@end
